package com.yueqian.common.utils;

import org.apache.log4j.PropertyConfigurator;

public class Log4jConfig {
    private static boolean isReload = true;
    public static void load() {
        String path = Log4jConfig.class.getClassLoader().getResource("/")
                .getPath()
                + "config/log4j.properties";
        //String path="config/log4j.properties";
        System.out.println("log4j configfile path=" + path);
        PropertyConfigurator.configureAndWatch(path,1000);
    }

    public static void reload() {
        if (isReload) {
            load();
        }
//        isReload = false;
    }

    public static void setReload(boolean flag) {
        isReload = flag;
    }

}